]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
screenshot: Hide screencast button when recorder is disabled
authorFlorian Müllner <fmuellner@gnome.org>
Wed, 27 Apr 2022 13:33:40 +0000 (15:33 +0200)
committerMarge Bot <marge-bot@gnome.org>
Fri, 29 Apr 2022 20:22:32 +0000 (20:22 +0000)
The screencast D-Bus service that is used for the recordings
is only installed if the necessary gstreamer and pipewire
dependencies are found at build time.

The screencast button cannot work when the service is missing,
so don't show it in the first place.

https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/2450

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2285>

js/misc/config.js.in
js/misc/meson.build
js/ui/screenshot.js

index 776a6c600019e273aacf5b4725236b373112d0fb..8cea70bc05240cda5edf69b151d52be186e3b82b 100644 (file)
@@ -10,6 +10,8 @@ var HAVE_BLUETOOTH = @HAVE_BLUETOOTH@;
 var HAVE_NETWORKMANAGER = @HAVE_NETWORKMANAGER@;
 /* 1 if soup2 should be used instead of soup3, 0 otherwise */
 var HAVE_SOUP2 = @HAVE_SOUP2@;
+/* 1 if recorder is enabled, 0 otherwise */
+var HAVE_RECORDER = @HAVE_RECORDER@;
 /* gettext package */
 var GETTEXT_PACKAGE = '@GETTEXT_PACKAGE@';
 /* locale dir */
index 582562711149e2b987b4a8b438fc15c523e8299d..43d6d99c6c709fcf2c960bb8115d91e47f1818d8 100644 (file)
@@ -6,6 +6,7 @@ jsconf.set('LIBMUTTER_API_VERSION', mutter_api_version)
 jsconf.set10('HAVE_BLUETOOTH', bt_dep.found())
 jsconf.set10('HAVE_NETWORKMANAGER', have_networkmanager)
 jsconf.set10('HAVE_SOUP2', have_soup2)
+jsconf.set10('HAVE_RECORDER', enable_recorder)
 jsconf.set('datadir', datadir)
 jsconf.set('libexecdir', libexecdir)
 
index 63069d21627b4a0bf212e4a3fc121404283872fa..98cfec46853cf3fdf1aafc38df2a419075f72598 100644 (file)
@@ -3,6 +3,7 @@
 
 const { Clutter, Cogl, Gio, GObject, GLib, Graphene, Gtk, Meta, Shell, St } = imports.gi;
 
+const Config = imports.misc.config;
 const GrabHelper = imports.ui.grabHelper;
 const Layout = imports.ui.layout;
 const Lightbox = imports.ui.lightbox;
@@ -1212,6 +1213,7 @@ var ScreenshotUI = GObject.registerClass({
         this._castButton = new St.Button({
             style_class: 'screenshot-ui-shot-cast-button',
             toggle_mode: true,
+            visible: Config.HAVE_RECORDER,
         });
         this._castButton.set_child(new St.Icon({ icon_name: 'camera-web-symbolic' }));
         this._castButton.connect('notify::checked',
@@ -1429,6 +1431,9 @@ var ScreenshotUI = GObject.registerClass({
         if (this._screencastInProgress)
             return;
 
+        if (mode === UIMode.SCREENCAST && !Config.HAVE_RECORDER)
+            return;
+
         this._castButton.checked = mode === UIMode.SCREENCAST;
 
         if (!this.visible) {